﻿using OpenSource.UPnP;
using System;

namespace MediaServer
{
    /// <summary>
    /// ConnectionManager service enables modeling of streaming capabilities of A/V devices, and binding of those
    /// capabilities between devices.
    /// </summary>
    public class DeviceConnectionManagerService : GenericConnectionManagerService
    {
        private ILogger logger;
        
        private void log(string message)
        {
            if (this.logger != null)
            {
                this.logger.log(String.Format("{0}: {1}", this.GetCaller().ToString(), message));
            }
        }

        public DeviceConnectionManagerService(ILogger logger)
            : base()
        {
            this.logger = logger;
        }

        /// <summary>
        /// Action: GetCurrentConnectionIDs
        /// </summary>
        /// <param name="ConnectionIDs">Associated State Variable: CurrentConnectionIDs</param>
        public override void GetCurrentConnectionIDs(out System.String ConnectionIDs)
        {
            ConnectionIDs = "";
            this.log("Not implemented: ConnectionManagerService_GetCurrentConnectionIDs(" + ")");
        }

        /// <summary>
        /// Action: GetCurrentConnectionInfo
        /// </summary>
        /// <param name="ConnectionID">Associated State Variable: A_ARG_TYPE_ConnectionID</param>
        /// <param name="RcsID">Associated State Variable: A_ARG_TYPE_RcsID</param>
        /// <param name="AVTransportID">Associated State Variable: A_ARG_TYPE_AVTransportID</param>
        /// <param name="ProtocolInfo">Associated State Variable: A_ARG_TYPE_ProtocolInfo</param>
        /// <param name="PeerConnectionManager">Associated State Variable: A_ARG_TYPE_ConnectionManager</param>
        /// <param name="PeerConnectionID">Associated State Variable: A_ARG_TYPE_ConnectionID</param>
        /// <param name="Direction">Associated State Variable: A_ARG_TYPE_Direction</param>
        /// <param name="Status">Associated State Variable: A_ARG_TYPE_ConnectionStatus</param>
        public override void GetCurrentConnectionInfo(System.Int32 ConnectionID, out System.Int32 RcsID, out System.Int32 AVTransportID, out System.String ProtocolInfo, out System.String PeerConnectionManager, out System.Int32 PeerConnectionID, out Enum_A_ARG_TYPE_Direction Direction, out Enum_A_ARG_TYPE_ConnectionStatus Status)
        {
            RcsID = 0;
            AVTransportID = 0;
            ProtocolInfo = "";
            PeerConnectionManager = "";
            PeerConnectionID = 0;
            Direction = GenericConnectionManagerService.Enum_A_ARG_TYPE_Direction.INPUT;
            Status = GenericConnectionManagerService.Enum_A_ARG_TYPE_ConnectionStatus.OK;
            this.log("Not implemented: ConnectionManagerService_GetCurrentConnectionInfo(" + ConnectionID.ToString() + ")");
        }

        /// <summary>
        /// Action: GetProtocolInfo
        /// </summary>
        /// <param name="Source">Associated State Variable: SourceProtocolInfo</param>
        /// <param name="Sink">Associated State Variable: SinkProtocolInfo</param>
        public override void GetProtocolInfo(out System.String Source, out System.String Sink)
        {
            Source = "";
            Sink = "";
            this.log("Not implemented: ConnectionManagerService_GetProtocolInfo(" + ")");
        }
    }
}
